package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserThaliMapper;
import com.ruoyi.system.domain.UserThali;
import com.ruoyi.system.service.IUserThaliService;

/**
 * 用户套餐Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-04
 */
@Service
public class UserThaliServiceImpl implements IUserThaliService 
{
    @Autowired
    private UserThaliMapper userThaliMapper;

    /**
     * 查询用户套餐
     * 
     * @param id 用户套餐主键
     * @return 用户套餐
     */
    @Override
    public UserThali selectUserThaliById(Long id)
    {
        return userThaliMapper.selectUserThaliById(id);
    }

    /**
     * 查询用户套餐列表
     * 
     * @param userThali 用户套餐
     * @return 用户套餐
     */
    @Override
    public List<UserThali> selectUserThaliList(UserThali userThali)
    {
        return userThaliMapper.selectUserThaliList(userThali);
    }

    /**
     * 新增用户套餐
     * 
     * @param userThali 用户套餐
     * @return 结果
     */
    @Override
    public int insertUserThali(UserThali userThali)
    {
        userThali.setCreateTime(DateUtils.getNowDate());
        return userThaliMapper.insertUserThali(userThali);
    }

    /**
     * 修改用户套餐
     * 
     * @param userThali 用户套餐
     * @return 结果
     */
    @Override
    public int updateUserThali(UserThali userThali)
    {
        userThali.setUpdateTime(DateUtils.getNowDate());
        return userThaliMapper.updateUserThali(userThali);
    }

    /**
     * 批量删除用户套餐
     * 
     * @param ids 需要删除的用户套餐主键
     * @return 结果
     */
    @Override
    public int deleteUserThaliByIds(Long[] ids)
    {
        return userThaliMapper.deleteUserThaliByIds(ids);
    }

    /**
     * 删除用户套餐信息
     * 
     * @param id 用户套餐主键
     * @return 结果
     */
    @Override
    public int deleteUserThaliById(Long id)
    {
        return userThaliMapper.deleteUserThaliById(id);
    }
}
